﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright file="NetworkingActivity.cs" company="DissingNelleman">
//   
// All rights reserved. </copyright>
// <summary>
//   The networking activity.
// </summary>
// --------------------------------------------------------------------------------------------------------------------

namespace ServiceLibrary.Models.Domain
{
    using System.Collections.Generic;

    using NHibernate.Mapping.ByCode.Conformist;

    using ServiceLibrary.Models.Base;

    /// <summary>
    /// The networking activity.
    /// </summary>
    public class NetworkingActivity : Entity
    {
        #region Constructors and Destructors

        /// <summary>
        /// Initializes a new instance of the <see cref="NetworkingActivity"/> class.
        /// </summary>
        public NetworkingActivity()
        {
            this.SupportForBusinessAttendance = new HashSet<Profile>();
            this.Presentations = new HashSet<Presentation>();
        }

        #endregion

        #region Public Properties

        /// <summary>
        /// Gets or sets the attendance.
        /// </summary>
        public virtual bool Attendance { get; set; }

        /// <summary>
        /// Gets or sets the booth.
        /// </summary>
        public virtual bool Booth { get; set; }

        /// <summary>
        /// Gets or sets the organizer.
        /// </summary>
        public virtual bool Organizer { get; set; }

        /// <summary>
        /// Gets or sets the presentation comment.
        /// </summary>
        public virtual string PresentationComment { get; set; }

        /// <summary>
        /// Gets or sets the presentations.
        /// </summary>
        public virtual ICollection<Presentation> Presentations { get; set; }

        /// <summary>
        /// Gets or sets the product type.
        /// </summary>
        public virtual string ProductType { get; set; }

        /// <summary>
        /// Gets or sets the support for business attendance.
        /// </summary>
        public virtual ICollection<Profile> SupportForBusinessAttendance { get; set; }

        /// <summary>
        /// Gets or sets whether its a networking event or not.
        /// </summary>
        public virtual bool IsNetworkingEvent { get; set; }

        /// <summary>
        /// Gets or sets whether its a conference event or not.
        /// </summary>
        public virtual bool IsConferenceEvent { get; set; }

        /// <summary>
        /// Gets or sets whether its a delegation travel event or not.
        /// </summary>
        public virtual bool IsDelegationTravel { get; set; }

        /// <summary>
        /// Gets or sets whether its a delegation travel event or not.
        /// </summary>
        public virtual bool IsProductLaunch { get; set; }

        /// <summary>
        /// Gets or sets whether it's national or international.
        /// </summary>
        public virtual bool IsNational { get; set; }




        #endregion
    }

    /// <summary>
    /// The networking activity mapping.
    /// </summary>
    public class NetworkingActivityMapping : ClassMapping<NetworkingActivity>
    {
        #region Constructors and Destructors

        /// <summary>
        /// Initializes a new instance of the <see cref="NetworkingActivityMapping"/> class.
        /// </summary>
        public NetworkingActivityMapping()
        {
            this.Property(x => x.ProductType, m => m.Length(int.MaxValue / 2));
            this.Property(x => x.Attendance);
            this.Property(x => x.IsNational);
            this.Property(x => x.Booth);
            this.Property(x => x.Organizer);
            this.Set(x => x.SupportForBusinessAttendance, c => { }, m => m.ManyToMany());
            this.Set(x => x.Presentations, c => { }, m => m.ManyToMany());
            this.Property(x => x.PresentationComment, m => m.Length(int.MaxValue / 2));
            this.Property(x => x.IsConferenceEvent);
            this.Property(x => x.IsNetworkingEvent);
            this.Property(x => x.IsDelegationTravel);
            this.Property(x => x.IsProductLaunch);
        }

        #endregion
    }
}